﻿using Currency.IServices.Shared.Models;
using Currency.IServices.User;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using User.IServices.Dto;

namespace User.WebApi.Controllers
{

    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserController : Controller
    {
        private readonly IUserInfoServices _userInfoServices;

        public UserController(IUserInfoServices userInfoServices)
        {
            _userInfoServices = userInfoServices;
        }

        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="userRegisterView"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResultMessage<long>> Register(UserRegisterDto userRegisterView) => await _userInfoServices.Create(userRegisterView);
    }
}
